From df524f377362a56e8f6b0a731d9ad763a8f197a4 Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Fri, 10 Sep 2004 17:40:57 +0000 Subject: [PATCH] bitkeeper revision 1.1159.75.1 (4141e7297AE7URpA2fz0RRbAQySy8w) Migration fix for immutable back pointers. --- tools/libxc/xc_linux_restore.c | 7 ++++++- xen/arch/x86/memory.c | 31 +++++++++++++------------------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/tools/libxc/xc_linux_restore.c b/tools/libxc/xc_linux_restore.c index fe7522e1ed..977a60f841 100644 --- a/tools/libxc/xc_linux_restore.c +++ b/tools/libxc/xc_linux_restore.c @@ -484,7 +484,12 @@ int xc_linux_restore(int xc_handle, XcIOContext *ioctxt) goto out; } } - else if ( pfn_type[i] == (L2TAB|LPINTAB) ) + } + + /* must pin all L1's before L2's (need consistent va back ptr) */ + for ( i = 0; i < nr_pfns; i++ ) + { + if ( pfn_type[i] == (L2TAB|LPINTAB) ) { if ( add_mmu_update(xc_handle, mmu, (pfn_to_mfn_table[i]<mm.shadow_mode == SHM_logdirty) ) - mark_dirty(&d->mm, pfn); + if ( unlikely(d->mm.shadow_mode == SHM_logdirty) && + mark_dirty(&d->mm, pfn) ) + d->mm.shadow_dirty_block_count++; put_page(&frame_table[pfn]); break; @@ -1739,7 +1740,7 @@ void ptwr_flush_inactive(void) } unmap_domain_mem(pl1e); - /* make pt page writable */ + /* make pt page write protected */ if (__get_user(pte, writable_pte)) { MEM_LOG("ptwr: Could not read pte at %p\n", writable_pte); domain_crash(); @@ -1816,21 +1817,10 @@ int ptwr_do_page_fault(unsigned long addr) } else { - l2_pgentry_t nl2e; - if ( ptwr_info[cpu].disconnected_pteidx >= 0 ) ptwr_reconnect_disconnected(); - PTWR_PRINTK(PP_A, ("[A] pl2e %p l2e %08lx pfn %08lx " - "taf %08x/%08x\n", pl2e, - l2_pgentry_val(*pl2e), - l1_pgentry_val(linear_pg_table - [(unsigned long)pl2e >> - PAGE_SHIFT]) >> PAGE_SHIFT, - frame_table[pfn].u.inuse.type_info, - frame_table[pfn].count_info)); - /* disconnect l1 page */ - nl2e = mk_l2_pgentry((l2_pgentry_val(*pl2e) & ~_PAGE_PRESENT)); - update_l2e(pl2e, *pl2e, nl2e); + + /* No need to actually disconnect L1 anymore in v2 wr_pt */ ptwr_info[cpu].disconnected_pteidx = (page->u.inuse.type_info & PGT_va_mask) >> PGT_va_shift; @@ -1841,11 +1831,16 @@ int ptwr_do_page_fault(unsigned long addr) frame_table[pfn].count_info)); ptwr_info[cpu].disconnected_l1va = addr; ptwr_info[cpu].disconnected_pl1e = - map_domain_mem(l2_pgentry_to_pagenr(nl2e) << PAGE_SHIFT); + map_domain_mem( l2_pgentry_to_pagenr(*pl2e)<u.inuse.type_info & PGT_va_mask) >> + PGT_va_shift) < (PAGE_OFFSET >> L2_PAGETABLE_SHIFT)); + memcpy(&ptwr_info[cpu].disconnected_page[0], ptwr_info[cpu].disconnected_pl1e, ENTRIES_PER_L1_PAGETABLE * sizeof(l1_pgentry_t)); - + /* make pt page writable */ ptwr_info[cpu].disconnected_pte = pte; pte = (virt_to_phys(ptwr_info[cpu].disconnected_page) & -- 2.30.2